<template>
  <div>
    <Header></Header>
    <router-view></router-view>
    <!-- 这样写可以但是麻烦. -->
    <Footer v-show="!$route.meta.isHidden"></Footer>
    <!-- <Footer
      v-show="$route.path !== '/login' && $route.path !== '/register'"
    ></Footer> -->
  </div>
</template>

<script>
import Header from '@/components/Header';
import Footer from '@/components/Footer';
export default {
  name: 'App',
  components: {
    Footer,
    Header,
  },
  mounted() {
    // 通知vuex发请求,获取数据存储在仓库中
    this.$store.dispatch('categoryList');
  },
};
</script>

<style scoped></style>
